<h2 class="title">{%if $act eq 'add'%}添加{%else%}修改{%/if%}计划执行</h2>
<form action="index.php?c=zy_sell&m={%$act%}&post=1" method=post name=frm enctype="multipart/form-data" onSubmit="return Validator.Validate(this,3)">
<table class="tb_term" width="100%">
<tr>
	<td class="alignright">计划批复编号</td>
	<td colspan="3">
	{%if !$v_mc_arr%}
	<div class="input_div_edit  floatleft table_border">&nbsp;</div>
	<div><label class="label01"><a href="index.php?c=zy_plan_reply&is_jump=1">请选择</a></label></div>
	{%else%}
		<div class="input_div_edit floatleft table_border">	
			{%foreach from=$plan_reply_no_arr item=plan_reply%}
				{%$plan_reply%}<br />
			{%/foreach%}
		</div>
		{%if $is_show != 1%}
		<div colspan="4" class="aligntop"><label class="label01"><a href="index.php?c=zy_plan_reply&is_jump=1">请重新选择</a></label></div>
		{%/if%}
	{%/if%}
	</td>
</tr>
<tr>
	<td class="tr_td_width01 alignright">合同编号</td>
	<td><input type=text name="contract_no"  value='{%$contract_no%}' class="input_edit_stand txt-normal" dataType="Require" msg="" {%if $is_show == 1%}readonly {%/if%}></td>
	<td  class="tr_td_width01 alignright">谈判人员</td>
	<td class="tr_td_width03">
		<select name="admin_user_id"  class="select_edit  txt-normal">
		{%html_options options=$admin_info selected=$admin_user_id%}
		</select>
	</td>
</tr>
<tr>	
	<td class="alignright">谈判日期</td>
	<td>
		<input type=text class="input_date_edit txt-normal" name="talks_time"  value='{%$talks_time|date_format:"%Y-%m-%d"%}' id="talks_time" readonly />
		<script>
		Calendar.setup({
		inputField     :    "talks_time",   // id of the input field
		ifFormat       :    "%Y-%m-%d",       // format of the input field
		showsTime      :    false,
		timeFormat     :    "24"
		});
		</script>
	</td>
	<td  class="alignright">合同总价</td>
	<td><input type=text class="input_edit_num txt-normal" name="contract_prices"  id="contract_prices" value='{%if $act == 'add'%}{%$contract_cost|string_format:"%.2f"%}{%else%}{%$contract_prices|string_format:"%.2f"%}{%/if%}'  dataType="Currency" msg="" ><label class="label01">万元(RMB)</label></td>
</tr>
<tr>
	<td class="alignright">签订日期</td>
	<td>
		<input type=text class="input_date_edit txt-normal" name="contract_time" value='{%$contract_time|date_format:"%Y-%m-%d"%}' id="contract_time"  readonly />
		<script>
			Calendar.setup({
				inputField     :    "contract_time",   // id of the input field
				ifFormat       :    "%Y-%m-%d",       // format of the input field
				showsTime      :    false,
				timeFormat     :    "24"
			});
		</script>
	</td>
	<td class="alignright">到货日期</td>
	<td>
		<input type=text class="input_date_edit txt-normal" name="finish_time" value='{%$finish_time|date_format:"%Y-%m-%d"%}' id="finish_time" readonly />
		<script>
			Calendar.setup({
				inputField     :    "finish_time",   // id of the input field
				ifFormat       :    "%Y-%m-%d",       // format of the input field
				showsTime      :    false,
				timeFormat     :    "24"
			});
		</script>
	</td>
</tr>
<tr>
	<td  class="alignright">外汇总价</td>
	<td ><input type=text name="exchange_price" id="exchange_price" value='{%$exchange_price|string_format:"%.2f"%}' class="input_edit_num txt-normal" onkeyup="change_num();" ><label class="label01">万元</label></td>
	<td  class="alignright">外汇汇率</td>
	<td><input type=text  name="exchange_rate"  value='{%$exchange_rate%}' id="exchange_rate" class="input_edit_num txt-normal" onkeyup="change_num();"></td>
</tr>
<tr>
	<td  class="alignright">供货厂商</td>
	<td>
		<select name="sell_owner" class="select_edit02 txt-normal">
			<option value="0">请选择</option>
			{%foreach from=$company_arr item=company%}
				<option value="{%$company%}" {%if $company == $sell_owner %}selected {%/if%}>{%$company%}</option>
			{%/foreach%}
		</select>
	</td>
	<td class="alignright">外汇币种</td>
	<td>
		<select name="currency_id"  class="select_edit txt-normal">
		{%html_options options=$price_type_arr selected=$currency_id%}
		</select>
	</td>
</tr>
<tr>
	<td class="alignright">合同备注</td>
	<td colspan="5"><textarea rows="3" class="textarea_edit txt-normal" id="contract_info" name="contract_info">{%$contract_info%}</textarea></td>
</tr>
{%if $v_mc_arr%}
<tr>
	<td colspan="4">
		<table class="tb_list" width="98%">
		<tr>
			<td>批复序号</td>
			<td>设备名称</td>
			<td>批复单号</td>
			<td class="list_td_zw_04">数量</td>
			<td class="list_td_zw_03">单位</td>
			<td class="list_td_zw_05">单价(万元)</td>
			<td class="list_td_zw_11">所属项目</td>
		</tr>
		{%foreach item=v_mc key=key from=$v_mc_arr%}
		<tr>
			<td class="alignleft">
			<input type="checkbox"  {%if $is_show ==1 %} checked disabled="disabled" {%/if%}  name="reply_mc_id_arr[]" value="{%$v_mc.plan_reply_mc_id%}" {%if $coun == $key %} dataType="Group"  min=1 msg="" {%/if%}>
			{%$v_mc.zy_plan_replay_no%}</td>
			<td class="alignleft"> {%$v_mc.mc_cn_name%}</td>
			
			<td class="alignleft">{%$plan_reply_no_arr[$v_mc.plan_reply_id]%}</td>
			<td><input type="hidden" class="txt-normal" name="reply_do_num_{%$v_mc.plan_reply_mc_id%}" size="5 "value="{%$v_mc.plan_reply_mc_number%}">{%$v_mc.plan_reply_mc_number%} </td>
			<td>{%$v_mc.unit%}</td>
			<td class="alignleft">{%$v_mc.plan_reply_mc_all_cost/$v_mc.plan_reply_mc_number|string_format:"%.2f"%}</td>
			<td class="alignleft" title="{%$project_arr[$v_mc.project_id]%}">{%cut_str str=$project_arr[$v_mc.project_id] sublen=10%}</td>
		</tr>
		{%/foreach%}
		</table>
	</td>	
</tr>
{%/if%}
</table>
<p class="btn_right">
	<input type="hidden" name="investment_no" value='{%$investment_no%}'>
	<button type="submit" class="b-default" hidefocus="true"><span><em>{%if $act eq 'add'%}提交{%else%}更新{%/if%}</em></span></button>	
	<button type="button" class="b-default" hidefocus="true" onclick="javascript:location.href='index.php?c=zy_sell'"><span><em>返回</em></span></button>
</p>
</form>
<script type="text/javascript">
function change_num(){
	var exchange_price= $("#exchange_price").val();
	var exchange_rate= $("#exchange_rate").val();
	//如果造价是数字 则改变 管理费和增值税数值 管理费=造价*2%；增值税=造价*17%
   // var re =  /^[1-9]+[0-9]*]*$/;  //判断正整数 
      if (exchange_price != null  && exchange_rate != null)   
     {   
     	contract_prices = exchange_price * exchange_rate;
		$("#contract_prices").val(contract_prices.toFixed(2));//管理费   
      }   
	
}
</script>